home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / newslist / FRMNEWSL.FRM < prev    next >
Text File  |  1998-09-27  |  9KB  |  279 lines

  1. VERSION 5.00
  2. Object = "{E2CE280B-255A-11D1-B2D1-E75DFE497A30}#11.0#0"; "NewsList.ocx"
  3. Begin VB.Form frmNewsListDemo 
  4.    Caption         =   "NewsList Demonstration"
  5.    ClientHeight    =   4485
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   7170
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   4485
  11.    ScaleWidth      =   7170
  12.    StartUpPosition =   2  'CenterScreen
  13.    Begin VB.HScrollBar HScroll1 
  14.       Height          =   240
  15.       LargeChange     =   1000
  16.       Left            =   3570
  17.       SmallChange     =   200
  18.       TabIndex        =   11
  19.       TabStop         =   0   'False
  20.       Top             =   4170
  21.       Width           =   3465
  22.    End
  23.    Begin VB.TextBox txtHeadline 
  24.       Height          =   285
  25.       Left            =   4170
  26.       TabIndex        =   5
  27.       Text            =   "txtHeadline"
  28.       Top             =   555
  29.       Width           =   2910
  30.    End
  31.    Begin VB.TextBox txtByline 
  32.       Height          =   285
  33.       Left            =   4170
  34.       TabIndex        =   7
  35.       Text            =   "txtByline"
  36.       Top             =   1155
  37.       Width           =   2910
  38.    End
  39.    Begin VB.TextBox txtBody 
  40.       Height          =   1350
  41.       Left            =   4170
  42.       MultiLine       =   -1  'True
  43.       ScrollBars      =   2  'Vertical
  44.       TabIndex        =   9
  45.       Text            =   "frmNewsListDemo.frx":0000
  46.       Top             =   1770
  47.       Width           =   2910
  48.    End
  49.    Begin VB.CommandButton cmdRemove 
  50.       Caption         =   "&Remove"
  51.       Height          =   345
  52.       Left            =   60
  53.       TabIndex        =   13
  54.       Top             =   4080
  55.       Width           =   1125
  56.    End
  57.    Begin VB.CommandButton cmdAdd 
  58.       Caption         =   "&Add"
  59.       Height          =   345
  60.       Left            =   4170
  61.       TabIndex        =   10
  62.       Top             =   3210
  63.       Width           =   2910
  64.    End
  65.    Begin VB.CheckBox chkPause 
  66.       Caption         =   "&Pause"
  67.       Height          =   285
  68.       Left            =   90
  69.       TabIndex        =   1
  70.       Top             =   3675
  71.       Width           =   885
  72.    End
  73.    Begin VB.CommandButton cmdBack 
  74.       Caption         =   "< &Back"
  75.       Height          =   345
  76.       Left            =   1800
  77.       TabIndex        =   2
  78.       Top             =   3645
  79.       Width           =   1125
  80.    End
  81.    Begin VB.CommandButton cmdNext 
  82.       Caption         =   "&Next >"
  83.       Height          =   345
  84.       Left            =   2925
  85.       TabIndex        =   3
  86.       Top             =   3645
  87.       Width           =   1125
  88.    End
  89.    Begin NewsListLib.NewsList NewsList1 
  90.       Height          =   3255
  91.       Left            =   60
  92.       Top             =   300
  93.       Width           =   4005
  94.       _ExtentX        =   7064
  95.       _ExtentY        =   5741
  96.       AutoSize        =   0   'False
  97.       Interval        =   5000
  98.       BorderWidth     =   2
  99.       BylineFooter    =   3
  100.       HeadlineFooter  =   0
  101.       BackColor       =   -2147483633
  102.       BorderStyle     =   1
  103.       PaletteMode     =   3
  104.       Palette         =   "frmNewsListDemo.frx":0008
  105.       Picture         =   "frmNewsListDemo.frx":0024
  106.       HeadlineColor   =   -2147483630
  107.       BeginProperty HeadlineFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  108.          Name            =   "MS Sans Serif"
  109.          Size            =   13.5
  110.          Charset         =   0
  111.          Weight          =   400
  112.          Underline       =   0   'False
  113.          Italic          =   0   'False
  114.          Strikethrough   =   0   'False
  115.       EndProperty
  116.       BylineColor     =   -2147483630
  117.       BeginProperty BylineFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  118.          Name            =   "MS Sans Serif"
  119.          Size            =   8.25
  120.          Charset         =   0
  121.          Weight          =   400
  122.          Underline       =   0   'False
  123.          Italic          =   -1  'True
  124.          Strikethrough   =   0   'False
  125.       EndProperty
  126.       BodyColor       =   -2147483630
  127.       BeginProperty BodyFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  128.          Name            =   "MS Sans Serif"
  129.          Size            =   8.25
  130.          Charset         =   0
  131.          Weight          =   400
  132.          Underline       =   0   'False
  133.          Italic          =   0   'False
  134.          Strikethrough   =   0   'False
  135.       EndProperty
  136.       Headline1       =   "NewsList ActiveX Control"
  137.       Byline1         =   "by LDrive"
  138.       Body1           =   $"frmNewsListDemo.frx":0040
  139.       Key1            =   ""
  140.       ItemTag1        =   ""
  141.       Headline2       =   "NewsList NewsItems"
  142.       Byline2         =   "NewsList ActiveX Control"
  143.       Body2           =   $"frmNewsListDemo.frx":0110
  144.       Key2            =   ""
  145.       ItemTag2        =   ""
  146.       Headline3       =   "NewsList Features"
  147.       Byline3         =   "NewsList!"
  148.       Body3           =   $"frmNewsListDemo.frx":021E
  149.       Key3            =   ""
  150.       ItemTag3        =   ""
  151.       Headline4       =   "NewsList pricing"
  152.       Byline4         =   "LDrive"
  153.       Body4           =   $"frmNewsListDemo.frx":02BB
  154.       Key4            =   ""
  155.       ItemTag4        =   ""
  156.       NewsItemCount   =   4
  157.    End
  158.    Begin VB.Label lblInterval 
  159.       Caption         =   "Interval:"
  160.       Height          =   240
  161.       Left            =   1440
  162.       TabIndex        =   12
  163.       Top             =   4170
  164.       Width           =   1425
  165.    End
  166.    Begin VB.Label Label3 
  167.       AutoSize        =   -1  'True
  168.       Caption         =   "Bo&dy:"
  169.       Height          =   195
  170.       Left            =   4185
  171.       TabIndex        =   8
  172.       Top             =   1530
  173.       Width           =   405
  174.    End
  175.    Begin VB.Label Label2 
  176.       AutoSize        =   -1  'True
  177.       Caption         =   "&Byline:"
  178.       Height          =   195
  179.       Left            =   4185
  180.       TabIndex        =   6
  181.       Top             =   915
  182.       Width           =   465
  183.    End
  184.    Begin VB.Label Label1 
  185.       AutoSize        =   -1  'True
  186.       Caption         =   "&Headline:"
  187.       Height          =   195
  188.       Left            =   4185
  189.       TabIndex        =   4
  190.       Top             =   315
  191.       Width           =   675
  192.    End
  193.    Begin VB.Label lblStatus 
  194.       AutoSize        =   -1  'True
  195.       Caption         =   "Click on the control to pause the display."
  196.       Height          =   195
  197.       Left            =   90
  198.       TabIndex        =   0
  199.       Top             =   60
  200.       Width           =   2865
  201.    End
  202. End
  203. Attribute VB_Name = "frmNewsListDemo"
  204. Attribute VB_GlobalNameSpace = False
  205. Attribute VB_Creatable = False
  206. Attribute VB_PredeclaredId = True
  207. Attribute VB_Exposed = False
  208. Option Explicit
  209.  
  210. Private Sub chkPause_Click()
  211.     NewsList1.Pause = (chkPause.Value = vbChecked)
  212.     
  213.     If chkPause.Value = vbChecked Then
  214.         lblStatus.Caption = "Paused.  Click again to resume."
  215.     Else
  216.         lblStatus.Caption = "Running.  Click to pause."
  217.     End If
  218.    
  219. End Sub
  220.  
  221. Private Sub cmdAdd_Click()
  222.     NewsList1.NewsItems.Add txtHeadline.Text, txtByline.Text, txtBody.Text
  223.     
  224. End Sub
  225.  
  226. Private Sub cmdBack_Click()
  227.     NewsList1.ShowPrevious
  228.     
  229. End Sub
  230.  
  231. Private Sub cmdNext_Click()
  232.     NewsList1.ShowNext
  233.     
  234. End Sub
  235.  
  236. Private Sub cmdRemove_Click()
  237.     Dim bPause As Boolean
  238.     
  239.     bPause = NewsList1.Pause
  240.     
  241.     NewsList1.Pause = True
  242.     If MsgBox("Are you sure you want to remove this item?", vbYesNo Or vbQuestion, App.Title) = vbYes Then
  243.         NewsList1.NewsItems.Remove NewsList1.CurrentNewsItem
  244.     End If
  245.     
  246.     NewsList1.Pause = bPause
  247.     
  248. End Sub
  249.  
  250. Private Sub Form_Load()
  251.     chkPause.Value = (NewsList1.Pause And vbChecked)
  252.     HScroll1.Value = (NewsList1.Interval \ 2)
  253.     lblInterval.Caption = "Interval: " & NewsList1.Interval
  254.     
  255. End Sub
  256.  
  257. Private Sub HScroll1_Change()
  258.     NewsList1.Interval = CLng(HScroll1.Value) * 2
  259.     lblInterval.Caption = "Interval: " & NewsList1.Interval
  260.  
  261. End Sub
  262.  
  263. Private Sub HScroll1_Scroll()
  264.     NewsList1.Interval